//
//  InformationListTableViewCell.m
//  ChineseCollegeStudentsNetwork
//
//  Created by 刘喆 on 2019/3/7.
//  Copyright © 2019年 刘喆. All rights reserved.
//

#import "InformationListTableViewCell.h"

@implementation InformationListTableViewCell

#pragma mark - Init
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self createSubviews];
    }
    return self;
}

#pragma mark - Subviews
#pragma amrk layout subviews
- (void)layoutSubviewsInView {
    
    [_titleL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.width.mas_equalTo(200);
        make.top.mas_equalTo(20);
        make.height.mas_equalTo (14);
    }];
    
    [_contentL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.width.mas_equalTo(200);
        make.top.equalTo(self.titleL.mas_bottom).offset(8);
        make.height.mas_equalTo (14);
    }];
    
    [_dataL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.width.mas_equalTo(200);
        make.top.equalTo(self.contentL.mas_bottom).offset(8);
        make.height.mas_equalTo (14);
    }];
    
    [_img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20);
        make.top.mas_equalTo(20);
        make.width.mas_equalTo (80);
        make.height.mas_equalTo (60);
    }];
}

#pragma mark create subviews
- (void)createSubviews {
    
    [self.contentView addSubview:self.titleL];
    [self.contentView addSubview:self.contentL];
    [self.contentView addSubview:self.dataL];
    [self.contentView addSubview:self.img];
    
    [self layoutSubviewsInView];
}



- (UILabel *)titleL {
    if (!_titleL) {
        _titleL = [[UILabel alloc] init];
        _titleL.font = [UIFont systemFontOfSize:14];
        _titleL.textColor = kRGB(153, 153, 153, 1);
        _titleL.text = @"订单编号：1234567654321234567";
    }
    return _titleL;
}

- (UILabel *)contentL {
    if (!_contentL) {
        _contentL = [[UILabel alloc] init];
        _contentL.font = [UIFont systemFontOfSize:14];
        _contentL.textColor = kRGB(153, 153, 153, 1);
        _contentL.text = @"金额： ¥48";
    }
    return _contentL;
}

- (UILabel *)dataL {
    if (!_dataL) {
        _dataL = [[UILabel alloc] init];
        _dataL.font = [UIFont systemFontOfSize:14];
        _dataL.textColor = kRGB(153, 153, 153, 1);
        _dataL.text = @"地址： hdddd";
    }
    return _dataL;
}

- (UIImageView *)img {
    if (!_img) {
        _img = [[UIImageView alloc] init];
        _img.backgroundColor = [UIColor yellowColor];
    }
    return _img;
}


@end
